﻿using MediatR;
using Medical.Domain.Enum;
using Medical.ErrorCode;

namespace Medical.Api.Write.Application.Command.Wms.WmsStorageCommand
{
    public class UptStorageCommand : IRequest<ApiResult<int>>
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 入库类型：0器械入库，5器械包入库
        /// </summary>
        public MaterialTypeEnum StorageType { get; set; }
        /// <summary>
        /// 入库编号
        /// </summary>
        public string? StorageCode { get; set; }
        /// <summary>
        /// 入库库房 枚举
        /// </summary>
        public WarehouseEnum Warehouse { get; set; }
        /// <summary>
        /// 供应商 枚举
        /// </summary>
        public SupplierEnum Supplier { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        public string? StorageExplain { get; set; }
        /// <summary>
        /// 入库状态 false登记/true审核
        /// </summary>
        public bool AuditState { get; set; } = false;
        /// <summary>
        /// 审核人
        /// </summary>
        public string? AuditName { get; set; }
        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime? AuditDate { get; set; }
        /// <summary>
        /// 入库明细表数据
        /// </summary>
        public List<UptStorageDetailCommand> StorageDetails { get; set; } = new();
    }
    /// <summary>
    /// 入库明细命令
    /// </summary>
    public class UptStorageDetailCommand
    {
        /// <summary>
        /// 入库主表Id
        /// </summary>
        public int StorageId { get; set; }
        /// <summary>
        /// 物品Id
        /// </summary>
        public int MaterialId { get; set; }
        /// <summary>
        /// 物品类型
        /// </summary>
        public MaterialTypeEnum MaterialType { get; set; }
        /// <summary>
        /// 物品编码
        /// </summary>
        public string? MaterialCode { get; set; }
        /// <summary>
        /// 物品名称
        /// </summary>
        public string? MaterialName { get; set; }
        /// <summary>
        /// 入库数量
        /// </summary>
        public int StorageNum { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        public string? MaterialSpecs { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        public decimal MaterialPrice { get; set; }
        /// <summary>
        /// 注册证号
        /// </summary>
        public string? RegisterNo { get; set; }
        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime ProduceDate { get; set; }
        /// <summary>
        /// 灭菌日期
        /// </summary>
        public DateTime SterilizaDate { get; set; }
        /// <summary>
        /// 失效日期
        /// </summary>
        public DateTime LapseDate { get; set; }
    }
}
